package com.example.demo.customer;

import com.example.demo.DemoApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.nio.file.Path;
import java.util.List;
@RequestMapping(path =  "api/v1/customer")
@RestController
@Deprecated
public class CustomerController {

    private final CustomerService customerService ;

    @Autowired
    public CustomerController(CustomerService customerService){
        this.customerService = customerService;
    }

    @GetMapping(path = "{customerId}")
    Customer getCustomers(@PathVariable("customerId")Long id){
        return customerService.getCustomers(id);
    }
@PostMapping
    void  createNewCustomer(@RequestBody Customer customer){
        System.out.println("POST 请求...");
        System.out.println(customer);



    }
    @PutMapping
    void updateCustomer(@RequestBody Customer customer){
        System.out.println("POST 请求...");
        System.out.println(customer);
}
    @DeleteMapping(path ="{customerId}")
    void deleteCustomer(@PathVariable("customerId") Long id){
        System.out.println("DELETF 请求，删除 Customer,其ID为"  +id);
}
}
